﻿/// <reference path="jquery.min.js" />

var leaveseconds;
function Tick() {

    setTimeout(Tick, 1000);
    var now = new Date();

    $("#datetimenow").text(now.getFullYear() + "年" + (now.getMonth() + 1) + "月" + now.getDate() + "日 " + now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds());


    leaveseconds--;
    if (leaveseconds <= 0) {
        $("#toBeginTime").hide();
        return;
    }
    $("#toBeginTime").hide();
    var day = parseInt(leaveseconds / 86400);
    var hour = parseInt(leaveseconds / 3600) - day * 24;
    var min = parseInt(leaveseconds % 3600 / 60);
    var sec = leaveseconds % 60;
    $("#leavespan").text(day + "天" + hour + "时" + min + "分" + sec + "秒");
    $("#toBeginSpan").text(day + "天" + hour + "时" + min + "分" + sec + "秒");
}

$().ready(function () {
    Tick();
});



